//文件下载
function upload(obj) {
    alert(obj);
    if(obj == "qiye"){
        alert(123);
        fuc("企业");
    }else if(obj == "geren"){
        fuc("个人");
    }
}

function fuc(obj) {
    alert("1231");
    swal({
            title: "生成"+obj+"客户模板",
            text: "将要生成"+obj+"客户模板",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "确定",
            closeOnConfirm: false
        },
        function () {
            $.ajax({
                url: "customer/download?filename=ceshi.xls",
                method: 'post',
                success: function (data) {
                    if (data == null) {
                        swal("失败！", "失败！", "Cancle");
                    } else {
                    }
                },
                error: function (data) {
                    alert("操作失败");
                    swal("失败！", "失败" + data.msg, "Cancel")
                }
            });
        });
}